package com.example.demo.thread.singleton;

/**
 * @Description: 饥饿模式 类加载的时候就创建实例，没有使用也会创建实例，浪费内存
 * @Author: LLL
 * @Date: 2020-03-19 14:08
 **/
public class HungrySingleton {

    private HungrySingleton() {
    }

    private static HungrySingleton instance = new HungrySingleton();

    public static HungrySingleton getInstance() {
        return instance;
    }
}
